trap 'rm -f /tmp/my_tmp_file_$$' INT
echo 'creating file my_tmp_file_$$'
date > /tmp/my_tmp_file_$$ 

echo "press ctrl+c to interrupt..."
while [ -f /tmp/my_tmp_file_$$ ]; do
    echo "file exists"
    sleep 1
done
echo "The file no longer exists"

trap INT
echo 'creating file my_tmp_file_$$'
date > /tmp/my_tmp_file_$$ 

echo "press ctrl+c to interrupt..."
while [ -f /tmp/my_tmp_file_$$ ]; do
    echo "file exists"
    sleep 1
done
echo "We never get here"

